/**
 * <p>Title: </p>
 * <p>Description: </p>
 * <p>Copyright: Copyright (c) 2005</p>
 * <p>Company: col</p>
 */
package com.googlecode.cswish.security.type;

/**
 * a structure that describles if the field can be operated or be visited
 *
 * @author Jerry.Feng Date: 2005-7-4 15:49:00
 * @version $id: $
 */
public class Field {
	String fieldName;

	boolean enableRead = true;
	boolean enableWrite = true;

	/*
	 * if this field isn't null, it means user can read the field only if the
	 * condition is true.
	 */
	String enableReadIfCond;
	/*
	 * if this field isn't null, it means user can write the field only if the
	 * condition is true.
	 */
	String enableWriteIfCond;

	public Field(String name) {
		this.fieldName = name;
	}
	
	public String getFieldName() {
		return fieldName;
	}

	public void setFieldName(String fieldName) {
		this.fieldName = fieldName;
	}

	public boolean isEnableRead() {
		return enableRead;
	}

	public void setEnableRead(boolean enableRead) {
		this.enableRead = enableRead;
	}

	public boolean isEnableWrite() {
		return enableWrite;
	}

	public void setEnableWrite(boolean enableWrite) {
		this.enableWrite = enableWrite;
	}

	public String getEnableReadIfCond() {
		return enableReadIfCond;
	}

	public void setEnableReadIfCond(String enableReadIfCond) {
		this.enableReadIfCond = enableReadIfCond;
	}

	public String getEnableWriteIfCond() {
		return enableWriteIfCond;
	}

	public void setEnableWriteIfCond(String enableWriteIfCond) {
		this.enableWriteIfCond = enableWriteIfCond;
	}
}
